<!--
 * @Description: 页脚
 * @Author: zhailei
 * @Date: 2021-06-02 13:38:08
 * @LastEditTime: 2021-09-18 13:34:26
 * 
 * @FilePath: \vite-demoe:\wwwroot\Vue\\-cloud-vue\src\layouts\footer\PageFooter.vue
-->
<template>
  <div class="footer">
    <div class="copyright">
      {{ copyright }}
      <a class="companyName" :href="companyWebsite" target="_blank">{{
        companyName
      }}</a>
    </div>
    <div class="links">
      <p class="version">{{ systemVersion }}</p>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "PageFooter",
  computed: {
    ...mapGetters(["configData"]),
    copyright() {
      let index = this.configData.findIndex(
        (item) => item.code === "copyright"
      );
      if (index >= 0) {
        return this.configData[index].value;
      } else {
        return "2022";
      }
    },
    companyWebsite() {
      let index = this.configData.findIndex(
        (item) => item.code === "companyWebsite"
      );
      if (index >= 0) {
        return this.configData[index].value;
      } else {
        return "https://www.lyg.com";
      }
    },
    companyName() {
      let index = this.configData.findIndex(
        (item) => item.code === "companyName"
      );
      if (index >= 0) {
        return this.configData[index].value;
      } else {
        return "";
      }
    },
    systemVersion() {
      let index = this.configData.findIndex(
        (item) => item.code === "systemVersion"
      );
      if (index >= 0) {
        return this.configData[index].value;
      } else {
        return "版本：V1.0.0";
      }
    },
  },
};
</script>

<style lang="less" scoped>
.footer {
  padding: 0 16px;
  margin: 0 0 10px;
  text-align: center;
  position: relative;
  .links {
    margin-bottom: 8px;
  }
  .copyright {
    text-align: center;
    color: rgba(0, 0, 0, 0.45);
    font-size: 13px;
    .companyName {
      color: rgba(0, 0, 0, 0.45);
    }
    .companyName:hover {
      color: @primary-color;
    }
  }
  .version {
    position: absolute;
    right: 12px;
    top: 0px;
    text-align: right;
    color: rgba(0, 0, 0, 0.45);
    font-size: 12px;
  }
}
</style>
